package com.example.design_patterns.factory_pattern;

/**
 * 工厂方法
 */
public class ShapeFactory {

    private Shape shape;

    public Shape getShape(String type){
        if(type.equals("circle")){
            return new Circle();
        }else if(type.equals("square")){
            return new Square();
        }
        return null;
    }
}
